"""myproject URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from django.views.generic import RedirectView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('catalog/', include('catalog.urls')),
    path('accounts/', include('django.contrib.auth.urls')),
    path('', RedirectView.as_view(url='catalog/', permanent=True)),
]
# urlpatterns = [
#     path('login/', views.LoginView.as_view(), name='login'),
#     path('logout/', views.LogoutView.as_view(), name='logout'),
#
#     path('password_change/', views.PasswordChangeView.as_view(), name='password_change'),
#     path('password_change/done/', views.PasswordChangeDoneView.as_view(), name='password_change_done'),
#
#     path('password_reset/', views.PasswordResetView.as_view(), name='password_reset'),  # 显示密码重置邮箱输入框  - 需要重写PasswordResetForm中的get_users,如果邮箱不存在抛异常
#     path('password_reset/done/', views.PasswordResetDoneView.as_view(), name='password_reset_done'),  # 提示用户邮件发送完成
#     path('reset/<uidb64>/<token>/', views.PasswordResetConfirmView.as_view(), name='password_reset_confirm'), # 显示密码重置密码和确认密码输入框
#     path('reset/done/', views.PasswordResetCompleteView.as_view(), name='password_reset_complete'), # 密码重置成功
# ]
# AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend']
